package com.security.common.code.sms;

import com.security.common.code.AbstractValidateCodeProcessor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.ServletWebRequest;

/**
 * @Author: TongRui乀
 * @Date: 2020/3/21 17:27
 * @description： 短信验证的实现逻辑
 */
@Component("smsValidateCodeProcessor")
public class SmsValidateCodeProcessor extends AbstractValidateCodeProcessor<ValidateCode> {

    @Autowired
    private SendProcessor sendProcessor;

    @Override
    protected void send(ValidateCode validateCode, ServletWebRequest request) {

        sendProcessor.send(request.getParameter("mobile"), validateCode.getCode());
    }
}
